import request from '@/utils/request'

//登录成功获取用户信息
export function getInfo() {
  return request({
    url: '/account/info',
    method: 'get'
  })
}
//登录
export function login(username, password) {
  const formData = new FormData();
  formData.append("username", username)
  formData.append("password", password)
  return request({
    url: '/account/login',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
    },
    data: formData
  })
}
//退出
export function logout() {
  return request({
    url: '/account/logout',
    method: 'post'
  })
}
//初始化系统配置
export function init() {
  return request({
    url: '/account/init',
    method: 'get',
  })
}
//初始化系统权限
export function getPermission() {
  return request({
    url: '/account/permission',
    method: 'get'
  })
}
//重置密码
export function resetPwd(data) {
  return request({
    url: '/account/resetPwd',
    method: 'post',
    data
  })
}
